<?php require_once('../Connections/mlu.php');

$query_Recordset1riclibri = "select ordini.data,count(*) as conto,round(sum(prezzo)/2,2) as prezzo_meeting
from carrelli
join ordini using (idordine)
join depositati using (idmlu)
group by ordini.data
order by ordini.data";
 $Result1 = mysql_query($query_Recordset1riclibri, $mlu) or die(mysql_error());
 $tot=mysql_num_rows($Result1); ?>
<h1>MOVIMENTO LIBRI IN VENDITA</h1>
<table border="1">
  <tr>
  <th>data</th>
  <th>totale</th>
  <th>prezzo meeting</th>
  </tr>
  <?php while ($row_Recordset1 = mysql_fetch_assoc($Result1))
  { ?>
	
    <tr>  
  <td><?php echo $row_Recordset1['data']; ?></td>
  <td><?php echo $row_Recordset1['conto']; ?></td>
<td><?php echo $row_Recordset1['prezzo_meeting']; ?></td>
  </tr>
  
  <?php }?>
  </table>
  
  
  <?php $query_Recordset1riclibri = "select ROUND(sum(prezzo)/2,2) as totale,count(carrelli.idmlu) as conto from carrelli join depositati using (idmlu)";
 $Result1 = mysql_query($query_Recordset1riclibri, $mlu) or die(mysql_error());
 $tot=mysql_num_rows($Result1);
 $row_Recordset1 = mysql_fetch_assoc($Result1); ?>
 <h1>totale libri venduti: <?php echo $row_Recordset1['conto']; ?></h1>
 
 <?php $ven=$row_Recordset1['totale']; ?>
 <h1>prezzo totale: <?php echo $ven; ?></h1>
   
